package April._16.homework.work2;

import java.io.File;

public class Main {
    public static void main(String[] args) {
        delAllDirFile(new File("target"));

    }

    private static boolean delAllDirFile(File target) {
        boolean flog=false;
        File[] files = target.listFiles();
        for (File file : files) {
            if(file.isFile()){
                file.delete();
            }else {
                File[] files1 = file.listFiles();
                if(files1.length==0){
                    file.delete();
                }else {
                    delAllDirFile(file);
                }

            }
        }
        flog=true;
        return flog;

    }
}
